{include file="public/head"/}
{include file="public/left"/}
<div class="main-content">
<div class="main-content-inner" id="getheight">
{include file="public/nav_head"/}
<form class="form-horizontal" method="post" id="form" action="{:url('nav/addHandle')}">
    <div class="row" style="margin:15px 0 0 0">
		<div class="col-xs-12 col-sm-12 col-md-9" id="myleft">
			<div class="panel panel-default">
		  		<div class="panel-heading">基本信息</div>
				<div class="panel-body" style="position:relative">
				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> 频道模型 </label>
				        <div class="col-sm-5">
				            <select class="form-control" id="cid" name="cid">
				                <option value="0">请选择栏目模型</option>
				                {foreach name="cals" item="oc"}
				                {if condition="$oc['status'] EQ 1"}
				                <option value="{$oc.id}" {if condition="$oc['id'] EQ $navself['cid']"}selected{/if} tpl="{$oc.table}">{$oc.name}
				                </option>
				                {/if}
				                {/foreach}
				            </select>
				        </div>
				        <label class="col-sm-1 control-label no-padding-right"> 所属栏目 </label>
				        <div class="col-sm-5">
				            <select class="form-control" id="pid" name="pid">
				                <option value="0">顶级栏目</option>
				                {foreach name="navlevel" item="nav"}
				                <option value="{$nav.id}" {if condition="$nav['id'] EQ $arc['id']"}selected{/if}>
				                    {if condition="$nav['level'] EQ 0"}{$nav.navname}{/if}
				                    {if condition="$nav['level'] EQ 1"}　{$nav.navname}{/if}
				                    {if condition="$nav['level'] EQ 2"}　　{$nav.navname}{/if}
				                    {if condition="$nav['level'] EQ 3"}　　　{$nav.navname}{/if}
				                </option>
				                {/foreach}
				            </select>
				        </div>
				    </div>
				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> 栏目标题 </label>
				        <div class="col-sm-5">
				            <input type="text" name="navname" id="navname" class="col-xs-12 col-sm-12" placeholder="栏目标题必填" />
				        </div>
				        <label class="col-sm-1 control-label no-padding-right"> 英文标题 </label>
				        <div class="col-sm-5">
				            <input type="text" name="ename" class="col-xs-12 col-sm-12" placeholder="可为空" />
				        </div>
				    </div>

				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> 栏目图标 </label>
				        <div class="col-sm-5">
				            <input type="text" name="litpic" id="litpic" class="col-xs-10 col-sm-10"/>
				            <a class="upbutton btn btn-primary" id="litpic_btn">选择</a>
				        </div>
				        
				        <label class="col-sm-1 control-label no-padding-right"> 跳转地址 </label>
				        <div class="col-sm-5">
				            <input type="text" name="jump" class="col-xs-12 col-sm-12"/>
				        </div>
				    </div>

				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> SEO标题 </label>
				        <div class="col-sm-11">
				            <input type="text" name="seotitle" class="col-xs-12 col-sm-12" placeholder="不填写将显示：栏目标题_网站标题" />
				        </div>
				    </div>

				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> 关 &nbsp;键 &nbsp;字 </label>
				        <div class="col-sm-11">
				            <input type="text" name="keywords" class="col-xs-12 col-sm-12" placeholder="多个关键字以英文逗号分割" />
				        </div>
				    </div>

				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> 内容摘要 </label>
				        <div class="col-sm-11">
				            <textarea name="description" rows="3" class="col-xs-12 col-sm-12" placeholder="本栏目的描述信息,控制在150字以内" style="padding:5px"></textarea>
				        </div>
				    </div>

				    <div class="form-group">
				        <label class="col-sm-1 control-label no-padding-right"> 栏目内容 </label>
				        <div class="col-sm-11">
				        <textarea name="content" id="content" class="col-xs-12 col-sm-12 pdno"  placeholder=""></textarea>
				        <script>var ue = UE.getEditor('content');</script>
				        </div>
				    </div>
				</div>
			</div>
		</div>
		<!--右边扩展信息-->
		<div class="col-xs-12 col-sm-12 col-md-3">
			<div class="panel panel-default" id="myright">
	  			<div class="panel-heading">其他选项</div>
	  			<div class="panel-body"  >
				    <div class="form-group">
				    	<label class="col-sm-12 no-padding-right"> 列表模板 </label>
				        <div class="col-sm-12">
				            <select class="form-control" id="tpl" name="tpl">
				                <option value="0">系统自动选择,特殊样式手动选择</option>
				                {foreach name="listtpl" item="t"}
				                <option value="{$t}" {if condition="$t EQ $arc['tpl']"}selected{/if}>{$t}</option>
				                {/foreach}
				            </select>
				        </div>
				    </div>
				    {if condition="$cfg['open_member'] EQ 'y'"}
				    <div class="form-group">
				        <label class="col-sm-12 no-padding-right"> 浏览权限 </label>
				        <div class="col-sm-12">
				            <select class="form-control" id="mgroupid" name="mgroupid">
				                {foreach name="authlist" item="a"}
				                <option value="{$a.gid}">{$a.gname}</option>
				                {/foreach}
				            </select>
				        </div>
				    </div>
				    {/if}
				</div>
				<div class="panel-footer text-center">
					<button class="ky_btn btn_blue" type="submit" style="padding:10px 25px">
				        <i class="ace-icon fa fa-check bigger-110"></i>保存
				    </button>
				</div>
			</div>
		</div>
	</div>
</form>
</div>
</div>
{include file="public/foot"/}
<script type="text/javascript">
     $('#form').ajaxForm({
        beforeSubmit : check,
        success : complete,
        dataType : 'json'
    });
    function check(){
        if($('#cid').val()==0){
            layer.tips('必选',$('#cid'));
            $('#cid').focus();
            return false;
        }
        if($('#navname').val()==''){
            layer.tips('必填',$('#navname') );
            $('#navname').focus();
            return false;
        }
    }
    function complete(data){
        if(data.status==0){
            layer.msg(data.msg,{icon:5});
        }
        if(data.status==1){
            layer.msg(data.msg,{icon:6,time:1500},function(){
                window.location.href=data.url;
            });
        }
    }
$(function(){
	var leftheight = $('#myleft').height();
	$('#myright .panel-body').css('height',leftheight+240);
});

</script>